package com.winit.feature.repository;

import com.winit.feature.model.VersionHistory;
import com.winit.feature.model.VersionHistoryId;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface VersionHistoryRepository extends CrudRepository<VersionHistory, VersionHistoryId> {
    VersionHistory findFirstByTypeAndReqIdAndRelationIdOrderByCreateTimeDesc(String type, String reqId, String relationId);
    List<VersionHistory> findByReqIdAndRelationIdAndType(String reqId, String relationId, String type);

    List<VersionHistory> findByRelationIdAndType(String relationId, String type);
}
